{extend name="Index/index" /}
{block name="main"}

<div class="content-page">

    <div class="content">

        <div class="page-heading">
            <h1><i class='fa fa-table'></i>角色管理</h1>
            <h3>分配权限</h3></div>

        <div class="row">

            <div class="col-md-12">

                <h4 >给&nbsp;<strong>{$user.username}</strong>&nbsp;分配权限</h4>

                <form class="form-horizontal"  action="{:url('admin/user/roleupdate')}" method="post" >
                    {volist name='list' key='key' id='val' }
                        <label class="checkbox-inline" >
                            <input type="checkbox"  name="role[]" value="{$val.id}"  {if condition="in_array($val.id,$myrole) eq true"}checked{/if} >&nbsp;{$val.name}
                        </label>
                    {/volist}
                    <input type="hidden" name="uid" value="{$user.id}">

                    <div class="form-group" style="margin-bottom:60px;">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button style="margin-top: 20px;"type="submit" class="btn btn-success">添加</button>
                            </button>
                        </div>
                    </div>
                </form>

            </div>
        </div>

    </div>

</div>
<script>
    function go(){
     window.history.go(-1);
    }
</script>


{/block}